<%= javascript_include_tag 'jquery.sortable.js' %>
<%= javascript_include_tag 'sort_products.js' %>

<div id='breadcrumb'>
  <a href="/">首页</a>&gt;<a href="/categories/<%=@category.id%>">焊接设备</a>&gt;商品排序(直接拖拽)
</div>
<ol id='sort_ul'>
  <% if @products %>
  
    <% for product in @products %>
      <li class='sortableitem' id='<%=product.id%>'>
        <%=h product.name %>
        <%=h product.purchase_price %>
      </li>
    <% end %>
  </ol>
  <button   onclick="print_ul('/products/update_sort_order')">保存顺序</button>
  <a href="/categories/<%=@category.id%><%="/?brand_id=#{params[:brand_id]}" if params[:brand_id]%>" class="action_back">返回</a>

<% end %>

<div style=""display:none id='hidden_form'>
  <%= form_tag('/categories')  %>
</div>